{include file="index/header"}
<body>
<div class="fly-panel fly-panel-user">
  <div class="tpt-admin">
    <fieldset class="layui-elem-field layui-field-title">
      <legend>修改采集器</legend>
    </fieldset>
    <form class="layui-form">
      <input type="hidden" name="id" value="{$Robotxuanpinku.id}">
      <!-- 采集器名称 -->
      <div class="layui-form-item">
        <label class="layui-form-label">采集器名称</label>
        <div class="layui-input-block">
          <input type="text" name="name" value="{$Robotxuanpinku.name}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
        </div>
      </div>
       <!-- 入库分类 -->
      <div class="layui-form-item" style="width: 300px;">
        <label class="layui-form-label">入库分类</label>
        <div class="layui-input-block">
          <select name="cid">
          {volist name="CategoryList" id="vo"}
            <option {if condition="$Robotxuanpinku['cid'] eq $vo['id']"}selected="selected"{/if} value="{$vo.id}">{$vo.name}</option>
          {/volist}
          </select>
        </div>
      </div>
      <!-- 选品库名称 -->
      <div class="layui-form-item">
        <label class="layui-form-label">选品库名称</label>
        <div class="layui-input-block">
          <input type="text" name="name" value="{$Robotxuanpinku.name}" placeholder="请输入内容" autocomplete="off" class="layui-input">
        </div>
      </div>
      <!-- 链接类型 -->
      <div class="layui-form-item">
        <label class="layui-form-label">链接类型</label>
        <div class="layui-input-block">
          <input type="radio" name="platform" value="1" title="PC" {if condition="$Robotxuanpinku['platform'] eq 1"}checked=""{/if}>
          <input type="radio" name="platform" value="2" title="无线" {if condition="$Robotxuanpinku['platform'] eq 2"}checked=""{/if}>
        </div>
      </div>              
      <!-- 选品库ID -->
      <div class="layui-form-item">
        <label class="layui-form-label">选品库ID</label>
        <div class="layui-input-block">
          <input type="text" name="catIds" value="{$Robotxuanpinku.catIds}" placeholder="请输入内容" autocomplete="off" class="layui-input">
        </div>
      </div>         
      <!-- 所属类型 -->
      <div class="layui-form-item">
        <label class="layui-form-label">所属类型</label>
        <div class="layui-input-block">
          <input type="radio" name="type" value="1" title="优惠卷" {if condition="$Robotxuanpinku['type'] eq 1"}checked=""{/if}>
          <input type="radio" name="type" value="2" title="不限" {if condition="$Robotxuanpinku['type'] eq 2"}checked=""{/if}>
        </div>
      </div>
      <!-- 采集页数 -->
      <div class="layui-form-item">
        <label class="layui-form-label">采集页数</label>
        <div class="layui-input-block">
          <input type="text" name="page" value="{$Robotxuanpinku.page}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
    	  <button class="layui-btn" lay-submit="" lay-filter="robotxuanpinku_edit">立即提交</button>
          <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
        </div>
      </div>
    </form>
  </div>
</div>
{include file="index_footer"}
<script type="text/javascript">
layui.use(['form'],function(){
  var form = layui.form()
  ,jq = layui.jquery;

  form.on('submit(robotxuanpinku_edit)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("robotxuanpinku/edit")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("robotxuanpinku/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });
})
</script>
</body>
</html>